program Length2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var
  x, y, z: array of integer;
  i, A, B, C, D: integer;
  l: extended;
  fin: textFile;

begin
  assignFile (fin, 'input.txt');
  reset(fin);
  setlength(x, 6);
  setlength(y, 6);
  setlength(z, 6);
  for i:= 1 to 5 do
    readln (fin, x[i], y[i], z[i]);
  A:= (y[1]-y[2])*(z[2]-z[3])-(z[2]-z[1])*(y[2]-y[3]);
  B:= -(x[1]-x[2])*(z[2]-z[3])-(z[2]-z[1])*(x[2]-x[3]);
  C:= (x[1]-x[2])*(y[3]-y[2])-(y[2]-y[1])*(x[2]-x[3]);
  D:= -A*x[1]-B*y[1]-C*z[1];
  if (A*x[4]+B*y[4]+C*z[4]=A*x[5]+B*y[5]+C*z[5]) then
    l:= (A*x[4]+B*y[4]+C*z[4]+D)/(sqrt(A*A+B*B+C*C))
  else
    l:= 0;
  writeln (l);
  readln;
end.
